{include file="common/head"/}
<div class="admin-main layui-anim layui-anim-upbit">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>{$list.two_cate}-{$list.one_cate == 0?'过夜房':'钟点房'}</legend>
    </fieldset>
    <form class="layui-form layui-form-pane">
        <input type="hidden" name="id" value="{$list.id}">

    

        <div class="layui-form-item">
            <label class="layui-form-label">开始时间</label>
            <div class="layui-input-4">
                <input type="text" maxlength="200" name="start_time" value="" id="start_time" lay-verify="required"
                    placeholder="活动开始时间" class="layui-input" autocomplete="off">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">结束时间</label>
            <div class="layui-input-4">
                <input type="text" maxlength="200" name="end_time" value="" id="end_time" lay-verify="required"
                    placeholder="活动结束时间" class="layui-input" autocomplete="off">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-4">
                <input type="radio" name="status" value="0" title="正常" checked>
                <input type="radio" name="status" value="1" title="下架">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">数量</label>
            <div class="layui-input-4">
                <input type="text" maxlength="200" name="num" value="" lay-verify="required" placeholder="请输入数量"
                    class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">价格</label>
            <div class="layui-input-4">
                <input type="text" maxlength="200" name="price" value="" lay-verify="required" placeholder="请输入价格"
                    class="layui-input">
            </div>
        </div>


        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" id="submit" lay-submit=""
                    lay-filter="sys">{:lang('submit')}</button>
                    <a class="layui-btn" id="close_box">返回</a>
            </div>
        </div>
    </form>
</div>
{include file="common/foot"/}
<script>
    var ue = UE.getEditor('content');
    ue.ready(function () {
        ue.setHeight(200);
        ue.addListener("contentChange", function () {
            $('#content').val(ue.getContent());
        });
    })

    layui.use(['form', 'layer', 'upload', 'laydate'], function () {
        var form = layui.form, layer = layui.layer, upload = layui.upload, $ = layui.jquery, laydate = layui.laydate;


        let start_time = laydate.render({
            elem: '#start_time',
            
        })
        let end_time = laydate.render({
            elem: '#end_time',
        })

        form.on('submit(sys)', function (data) {
            $("#submit").attr({ disabled: "disabled" });
            loading = layer.load(1, { shade: [0.1, '#fff'] });
          
            $.post("{:url('priceedit')}", data.field, function (res) {
                layer.close(loading);
                if (res.code == 200) {
                    layer.msg(res.msg, { icon: 1, time: 1000 }, function () {
                        parent.closeinframe()
                    
                    });
                } else {
                    $("#submit").removeAttr("disabled");
                    layer.msg(res.msg, { icon: 2, time: 1000 });
                }
            });
        })
        $('.close_box').click(function(){
            parent.closeinframe()
        })
     
    })


</script>


</body>

</html>